package com.keti.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.keti.Dao.UserDao;
import com.keti.Dao.stuffDao;
import com.keti.DaoImpl.UserDaoImpl;
import com.keti.DaoImpl.suffDaoImpl;
import com.keti.pojo.User;
import com.keti.pojo.stuff;


/**
 * Servlet implementation class AdminInterfaneServlet
 */
@WebServlet("/AdminInterfaceServlet")
public class AdminInterfaneServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		UserDao u = new UserDaoImpl();
		List<User> list1 = new ArrayList<User>();
		list1 = u.queryAll();
		request.setAttribute("list1", list1);
		stuffDao s = new suffDaoImpl();
		List<stuff> list2 = new ArrayList<stuff>();
		list2 = s.queryAll();
		request.setAttribute("list2", list2);
		request.getRequestDispatcher("/jsp"
				+ "/AdminInterface.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		doGet(request, response);
	}

}
